<?php
/**
 *	@author wyl
 *	@date 2015-8-18 13:44:51
 */
Yii::import('application.components.cronjob.class.*');
class StartCommand{
	public $command;
	
	public function __construct(){
		$this->init();
	}
	
	public function init(){
		$this->command = Yii::getPathOfAlias('application');
	
	}
	
	public function run($command,$params = array()){
		$runCommand = $command;
		$cliParams = implode(' ', $params);
		$sysCommand= 'nohup '.$this->command.'/./yiic '.$runCommand.' '.$cliParams .' >'.$runCommand.'.log 2>&1 &';
		exec($sysCommand);
	}
}
